<?php
namespace Home\Controller;
use Think\Controller;
class SetController extends BaseController {
    public function lst(){
        $user_id = session('user_id');
        $userData = M('Admin')->find($user_id);
        $shouid = explode(',',$userData['shouye']);

        $data = D('setindex')->select();
        $this->assign('data',$data);
        $this->assign('shouid',$shouid);

        $this->display();
    }
    public function updateData(){
        $data['shouye'] = I('post.ids');
        $data['id'] = session('user_id');
        $res = M('Admin')->save($data);
        if($res){
            show(1,'信息更改成功','');
        }
    }
}